package hotel.util;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

public class ObservableModel implements IObservableModel {
	
	// ATTRIBUTS
	
	protected final PropertyChangeSupport listeners;
	
	// CONSTRUCTEUR
	
	public ObservableModel() {
		listeners = new PropertyChangeSupport(this);
	}
	
	// REQUETES

	@Override
	public PropertyChangeListener[] getPropertyChangeListeners() {
		return listeners.getPropertyChangeListeners();
	}
	
	// COMMANDES

	@Override
	public void addPropertyChangeListener(PropertyChangeListener l) {
		listeners.addPropertyChangeListener(l);
	}

	@Override
	public void removePropertyChangeListener(PropertyChangeListener l) {
		listeners.removePropertyChangeListener(l);
	}

}
